<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        @property --my-color {
            syntax: "<color>";
            initial-value: indigo;
            inherits: false;
        }

        .container {
            width: 200px;
            height: 200px;
            animation: all 3s linear infinite;
        }

        @keyframes all {
            0% {
                background-color: blue;
            }

            50% {
                background-color: red;
            }

            100% {
                background-color: var(--my-color);
            }
        }
    </style>
</head>

<body>
    <div class="container"></div>
</body>

</html>